/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package BL;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author sundas
 */
@Embeddable
public class OrderlineitemPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "productNumber", nullable = false)
    private int productNumber;
    @Basic(optional = false)
    @Column(name = "orderLineId", nullable = false)
    private int orderLineId;
    @Basic(optional = false)
    @Column(name = "orderId", nullable = false)
    private int orderId;

    public OrderlineitemPK() {
    }

    public OrderlineitemPK(int productNumber, int orderLineId, int orderId) {
        this.productNumber = productNumber;
        this.orderLineId = orderLineId;
        this.orderId = orderId;
    }

    public int getProductNumber() {
        return productNumber;
    }

    public void setProductNumber(int productNumber) {
        this.productNumber = productNumber;
    }

    public int getOrderLineId() {
        return orderLineId;
    }

    public void setOrderLineId(int orderLineId) {
        this.orderLineId = orderLineId;
    }

    public int getOrderId() {
        return orderId;
    }

    public void setOrderId(int orderId) {
        this.orderId = orderId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) productNumber;
        hash += (int) orderLineId;
        hash += (int) orderId;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof OrderlineitemPK)) {
            return false;
        }
        OrderlineitemPK other = (OrderlineitemPK) object;
        if (this.productNumber != other.productNumber) {
            return false;
        }
        if (this.orderLineId != other.orderLineId) {
            return false;
        }
        if (this.orderId != other.orderId) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "DB.OrderlineitemPK[productNumber=" + productNumber + ", orderLineId=" + orderLineId + ", orderId=" + orderId + "]";
    }

}
